package cn.com.bluemoon.daps.api.model;

import cn.com.bluemoon.daps.api.model.factory.RemoteDataModelRecordServiceFallbackFactory;
import cn.com.bluemoon.daps.common.constant.ServiceNameConstants.DapsApiModel;
import cn.com.bluemoon.daps.common.domain.ResultBean;
import cn.com.bluemoon.daps.model.entity.DapDataModelRecord;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;

import java.time.LocalDateTime;
import java.util.Optional;

/**
 * @author Jarod.Kong
 * @date 2020/12/22 9:08
 */
@FeignClient(value = DapsApiModel.SERVICE, fallbackFactory = RemoteDataModelRecordServiceFallbackFactory.class)
@RequestMapping(DapsApiModel.BASE_URI + DapsApiModel.API_MODEL_RECORD)
@ApiIgnore
public interface RemoteDataModelRecordService {
    @GetMapping("/getMaxReleaseTime")
    Optional<LocalDateTime> findMaxReleaseTimeBySystemId(@RequestParam("systemId") String systemId);

    @GetMapping("/exists/record")
    ResultBean<DapDataModelRecord> existsRecordByModelId(@RequestParam("modelId") String modelId);
}
